﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for NhaDatMenuManager
/// </summary>
public class CanThueMenuManager
{
    CanThueMenuDAO canThueMenuDao = new CanThueMenuDAO();
    public CanThueMenuManager()
    {

    }

    public List<CanThue> getAllCanThueMenu()
    {
        List<CanThue> result = new List<CanThue>();

        DataTable dt = canThueMenuDao.GetDataCanThue();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            CanThue nd = new CanThue();
            nd.Ten = Convert.ToString(dt.Rows[i]["Ten"]);
            nd.ID = Convert.ToString(dt.Rows[i]["ID"]);
            result.Add(nd);
        }
        return result;
    }

    public DataTable getAllCanThueMenuReturnDT()
    {
        DataTable dt = canThueMenuDao.GetDataCanThue();

        if (dt != null)
            return dt;

        return new DataTable();
    }

    public bool UpdateCanThueMenu(CanThue canThue)
    {
        return canThueMenuDao.UpdateCanThueMenu(canThue);
    }

    public bool DeleteCanThueMenu(CanThue canThue)
    {
        return canThueMenuDao.DeleteCanThueMenu(canThue);
    }

    public bool InsertCanThueMenu(CanThue canThue)
    {
        return canThueMenuDao.InsertCanThueMenu(canThue);
    }
}